﻿using System;
using Infrastructure.Interfaces;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace Infrastructure.Services
{
    public class JsonSerializer : IJsonSerializer
    {
        public T Deserialize<T>(string jsonString)
        {
            return JsonConvert.DeserializeObject<T>(jsonString);
        }

        public JArray Deserialize(string jsonString)
        {
            return (JArray)JsonConvert.DeserializeObject(jsonString);
        }
    }
}
